package cn.jiyun.dao;

import cn.jiyun.pojo.OrderSetting;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.Date;
import java.util.List;
import java.util.Map;

public interface OrderSettingDao {
    void add(OrderSetting orderSetting);

    @Select("SELECT DAY(orderDate) as date ,number,reservations FROM t_ordersetting WHERE orderDate like '${value}%'")
    List<Map<String, Object>> getDataByOrderDate(String orderDate);

    @Select("SELECT * FROM t_ordersetting WHERE orderDate = #{orderDate}")
    OrderSetting findByOrderDate(String orderDate);

    @Update("update t_ordersetting set number = #{number} where orderDate = #{orderDate}")
    void update(OrderSetting orderSetting);

    @Update("update t_ordersetting set reservations = #{reservations} where orderDate = #{orderDate}")
    void updateByOrderDate(OrderSetting orderSetting);
}
